package cn.iocoder.yudao.module.erp.dal.mysql.planinfo;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.erp.controller.admin.planinfo.vo.PlanInfoPageReqVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.planinfo.PlanInfoDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 每日计划 Mapper
 *
 * @author mhc
 */
@Mapper
public interface PlanInfoMapper extends BaseMapperX<PlanInfoDO> {


    int updateSaleStatus1ByIds(@Param("ids") String[] ids,@Param("status")Integer status);

    int updateSaleBillStatus1ByIds(@Param("ids") String[] ids,@Param("status")Integer status);

    int updateBuyStatus1ByIds(@Param("ids") String[] ids,@Param("status")Integer status);

    int updateBuyBillStatus1ByIds(@Param("ids") String[] ids,@Param("status")Integer status);
    default PageResult<PlanInfoDO> selectPage(PlanInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PlanInfoDO>()
                .eqIfPresent(PlanInfoDO::getCompanyId, reqVO.getCompanyId())
                .betweenIfPresent(PlanInfoDO::getNowTime, reqVO.getNowTime())
                .eqIfPresent(PlanInfoDO::getUpId, reqVO.getUpId())
                .eqIfPresent(PlanInfoDO::getDownloadId, reqVO.getDownloadId())
                .eqIfPresent(PlanInfoDO::getCheckType, reqVO.getCheckType())
                .eqIfPresent(PlanInfoDO::getCheckCompany, reqVO.getCheckCompany())
                .eqIfPresent(PlanInfoDO::getBuyContractId, reqVO.getBuyContractId())
                .eqIfPresent(PlanInfoDO::getGasResource, reqVO.getGasResource())
                .betweenIfPresent(PlanInfoDO::getProfit, reqVO.getProfit())
                .eqIfPresent(PlanInfoDO::getSaleCustomerId, reqVO.getSaleCustomerId())
                .betweenIfPresent(PlanInfoDO::getSalePrice, reqVO.getSalePrice())
                .betweenIfPresent(PlanInfoDO::getSaleRealPrice, reqVO.getSaleRealPrice())
                .betweenIfPresent(PlanInfoDO::getSaleSubCount, reqVO.getSaleSubCount())
                .betweenIfPresent(PlanInfoDO::getSaleRealCount, reqVO.getSaleRealCount())
                .betweenIfPresent(PlanInfoDO::getSaleAllCount, reqVO.getSaleAllCount())
                .eqIfPresent(PlanInfoDO::getSaleContractId, reqVO.getSaleContractId())
                .eqIfPresent(PlanInfoDO::getSaleAccountStatus, reqVO.getSaleAccountStatus())
                .eqIfPresent(PlanInfoDO::getSaleBillStatus, reqVO.getSaleBillStatus())
                .eqIfPresent(PlanInfoDO::getBuyCustomerId, reqVO.getBuyCustomerId())
                .betweenIfPresent(PlanInfoDO::getBuyPrice, reqVO.getBuyPrice())
                .betweenIfPresent(PlanInfoDO::getBuyOtherPrice, reqVO.getBuyOtherPrice())
                .betweenIfPresent(PlanInfoDO::getBuyRealPrice, reqVO.getBuyRealPrice())
                .betweenIfPresent(PlanInfoDO::getBuySubCount, reqVO.getBuySubCount())
                .betweenIfPresent(PlanInfoDO::getBuyRealCount, reqVO.getBuyRealCount())
                .betweenIfPresent(PlanInfoDO::getBuyAllCount, reqVO.getBuyAllCount())
                .eqIfPresent(PlanInfoDO::getBuyAccountStatus, reqVO.getBuyAccountStatus())
                .eqIfPresent(PlanInfoDO::getBuyBillStatus, reqVO.getBuyBillStatus())
                .eqIfPresent(PlanInfoDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(PlanInfoDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PlanInfoDO::getCreateTime));
    }

}